<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Paho C++: mqtt::topic Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Paho C++
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">The Paho MQTT C++ Client Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classmqtt_1_1topic.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classmqtt_1_1topic-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">mqtt::topic Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Represents a topic destination, used for publish/subscribe messaging.  
 <a href="classmqtt_1_1topic.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="topic_8h_source.html">topic.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a5e94471a0af9ef527a90b5280c1cdf2b"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a5e94471a0af9ef527a90b5280c1cdf2b">ptr_t</a> = std::shared_ptr&lt; <a class="el" href="classmqtt_1_1topic.html">topic</a> &gt;</td></tr>
<tr class="memdesc:a5e94471a0af9ef527a90b5280c1cdf2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">A smart/shared pointer to this class.  <a href="#a5e94471a0af9ef527a90b5280c1cdf2b">More...</a><br/></td></tr>
<tr class="separator:a5e94471a0af9ef527a90b5280c1cdf2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7501cd52070ff3e86f6f322e2c4c31fc"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a7501cd52070ff3e86f6f322e2c4c31fc">const_ptr_t</a> = std::shared_ptr&lt; const <a class="el" href="classmqtt_1_1topic.html">topic</a> &gt;</td></tr>
<tr class="memdesc:a7501cd52070ff3e86f6f322e2c4c31fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">A smart/shared pointer to this class.  <a href="#a7501cd52070ff3e86f6f322e2c4c31fc">More...</a><br/></td></tr>
<tr class="separator:a7501cd52070ff3e86f6f322e2c4c31fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3f20abd05f9f841232d1ad81ecb814dd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a3f20abd05f9f841232d1ad81ecb814dd">topic</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli, const string &amp;name, int qos=<a class="el" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a>, bool retained=<a class="el" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a>)</td></tr>
<tr class="memdesc:a3f20abd05f9f841232d1ad81ecb814dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct an MQTT topic destination for messages.  <a href="#a3f20abd05f9f841232d1ad81ecb814dd">More...</a><br/></td></tr>
<tr class="separator:a3f20abd05f9f841232d1ad81ecb814dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20bb6ded44502aa1dd1f235883cca8bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a20bb6ded44502aa1dd1f235883cca8bf">get_client</a> ()</td></tr>
<tr class="memdesc:a20bb6ded44502aa1dd1f235883cca8bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a reference to the MQTT client used by this topic.  <a href="#a20bb6ded44502aa1dd1f235883cca8bf">More...</a><br/></td></tr>
<tr class="separator:a20bb6ded44502aa1dd1f235883cca8bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cc52b6439851356b32459533dc96b55"><td class="memItemLeft" align="right" valign="top">const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a7cc52b6439851356b32459533dc96b55">get_name</a> () const </td></tr>
<tr class="memdesc:a7cc52b6439851356b32459533dc96b55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the name of the topic.  <a href="#a7cc52b6439851356b32459533dc96b55">More...</a><br/></td></tr>
<tr class="separator:a7cc52b6439851356b32459533dc96b55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa155b7dc33fa0ef8ecace578cace2d4e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#aa155b7dc33fa0ef8ecace578cace2d4e">get_qos</a> () const </td></tr>
<tr class="memdesc:aa155b7dc33fa0ef8ecace578cace2d4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the default quality of service for this topic.  <a href="#aa155b7dc33fa0ef8ecace578cace2d4e">More...</a><br/></td></tr>
<tr class="separator:aa155b7dc33fa0ef8ecace578cace2d4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a570c51a6a1b004aa64754102239e3116"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a570c51a6a1b004aa64754102239e3116">get_retained</a> () const </td></tr>
<tr class="memdesc:a570c51a6a1b004aa64754102239e3116"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the default retained flag used for this topic.  <a href="#a570c51a6a1b004aa64754102239e3116">More...</a><br/></td></tr>
<tr class="separator:a570c51a6a1b004aa64754102239e3116"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1503219df15de428ff11ecc69099a9b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a1503219df15de428ff11ecc69099a9b7">set_qos</a> (int qos)</td></tr>
<tr class="memdesc:a1503219df15de428ff11ecc69099a9b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the default quality of service for this topic.  <a href="#a1503219df15de428ff11ecc69099a9b7">More...</a><br/></td></tr>
<tr class="separator:a1503219df15de428ff11ecc69099a9b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6464a44498c4ceb14d7038ec45b88ab0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a6464a44498c4ceb14d7038ec45b88ab0">set_retained</a> (bool retained)</td></tr>
<tr class="memdesc:a6464a44498c4ceb14d7038ec45b88ab0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the default retained flag used for this topic.  <a href="#a6464a44498c4ceb14d7038ec45b88ab0">More...</a><br/></td></tr>
<tr class="separator:a6464a44498c4ceb14d7038ec45b88ab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a245cb5fa74d692edf1f069b6cbdd2809"><td class="memItemLeft" align="right" valign="top">delivery_token_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a245cb5fa74d692edf1f069b6cbdd2809">publish</a> (const void *payload, size_t n)</td></tr>
<tr class="memdesc:a245cb5fa74d692edf1f069b6cbdd2809"><td class="mdescLeft">&#160;</td><td class="mdescRight">Publishes a message on the topic using the default QoS and retained flag.  <a href="#a245cb5fa74d692edf1f069b6cbdd2809">More...</a><br/></td></tr>
<tr class="separator:a245cb5fa74d692edf1f069b6cbdd2809"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32155e22ade2879fda7eb6af94e1edc2"><td class="memItemLeft" align="right" valign="top">delivery_token_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a32155e22ade2879fda7eb6af94e1edc2">publish</a> (const void *payload, size_t n, int qos, bool retained)</td></tr>
<tr class="memdesc:a32155e22ade2879fda7eb6af94e1edc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Publishes a message on the topic.  <a href="#a32155e22ade2879fda7eb6af94e1edc2">More...</a><br/></td></tr>
<tr class="separator:a32155e22ade2879fda7eb6af94e1edc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8be5358f0ab80036184a89960daee9a0"><td class="memItemLeft" align="right" valign="top">delivery_token_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a8be5358f0ab80036184a89960daee9a0">publish</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)</td></tr>
<tr class="memdesc:a8be5358f0ab80036184a89960daee9a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Publishes a message on the topic using the default QoS and retained flag.  <a href="#a8be5358f0ab80036184a89960daee9a0">More...</a><br/></td></tr>
<tr class="separator:a8be5358f0ab80036184a89960daee9a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa34a4625a889d5d1bfdf2f262ddade2d"><td class="memItemLeft" align="right" valign="top">delivery_token_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#aa34a4625a889d5d1bfdf2f262ddade2d">publish</a> (<a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload, int qos, bool retained)</td></tr>
<tr class="memdesc:aa34a4625a889d5d1bfdf2f262ddade2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Publishes a message on the topic.  <a href="#aa34a4625a889d5d1bfdf2f262ddade2d">More...</a><br/></td></tr>
<tr class="separator:aa34a4625a889d5d1bfdf2f262ddade2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae38b14f29acefc573904e4ac71e69791"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#ae38b14f29acefc573904e4ac71e69791">to_string</a> () const </td></tr>
<tr class="memdesc:ae38b14f29acefc573904e4ac71e69791"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string representation of this topic.  <a href="#ae38b14f29acefc573904e4ac71e69791">More...</a><br/></td></tr>
<tr class="separator:ae38b14f29acefc573904e4ac71e69791"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a05d1dd48249e94ae3d8c82b3a1b28372"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classmqtt_1_1topic.html#a5e94471a0af9ef527a90b5280c1cdf2b">ptr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1topic.html#a05d1dd48249e94ae3d8c82b3a1b28372">create</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli, const string &amp;name, int qos=<a class="el" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a>, bool retained=<a class="el" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a>)</td></tr>
<tr class="memdesc:a05d1dd48249e94ae3d8c82b3a1b28372"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new topic.  <a href="#a05d1dd48249e94ae3d8c82b3a1b28372">More...</a><br/></td></tr>
<tr class="separator:a05d1dd48249e94ae3d8c82b3a1b28372"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a topic destination, used for publish/subscribe messaging. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a7501cd52070ff3e86f6f322e2c4c31fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1topic.html#a7501cd52070ff3e86f6f322e2c4c31fc">mqtt::topic::const_ptr_t</a> =  std::shared_ptr&lt;const <a class="el" href="classmqtt_1_1topic.html">topic</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A smart/shared pointer to this class. </p>

</div>
</div>
<a class="anchor" id="a5e94471a0af9ef527a90b5280c1cdf2b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classmqtt_1_1topic.html#a5e94471a0af9ef527a90b5280c1cdf2b">mqtt::topic::ptr_t</a> =  std::shared_ptr&lt;<a class="el" href="classmqtt_1_1topic.html">topic</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A smart/shared pointer to this class. </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3f20abd05f9f841232d1ad81ecb814dd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">mqtt::topic::topic </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&#160;</td>
          <td class="paramname"><em>cli</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em> = <code><a class="el" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em> = <code><a class="el" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct an MQTT topic destination for messages. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cli</td><td>Client to which the topic is attached </td></tr>
    <tr><td class="paramname">name</td><td>The topic string </td></tr>
    <tr><td class="paramname">qos</td><td>The default QoS for publishing. </td></tr>
    <tr><td class="paramname">retained</td><td>The default retained flag for the topic. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a05d1dd48249e94ae3d8c82b3a1b28372"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classmqtt_1_1topic.html#a5e94471a0af9ef527a90b5280c1cdf2b">ptr_t</a> mqtt::topic::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&#160;</td>
          <td class="paramname"><em>cli</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em> = <code><a class="el" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em> = <code><a class="el" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a new topic. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cli</td><td>Client to which the topic is attached </td></tr>
    <tr><td class="paramname">name</td><td>The topic string </td></tr>
    <tr><td class="paramname">qos</td><td>The default QoS for publishing. </td></tr>
    <tr><td class="paramname">retained</td><td>The default retained flag for the topic. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A shared pointer to the topic. </dd></dl>

</div>
</div>
<a class="anchor" id="a20bb6ded44502aa1dd1f235883cca8bf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a>&amp; mqtt::topic::get_client </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets a reference to the MQTT client used by this topic. </p>
<dl class="section return"><dt>Returns</dt><dd>The MQTT client used by this topic </dd></dl>

</div>
</div>
<a class="anchor" id="a7cc52b6439851356b32459533dc96b55"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const string&amp; mqtt::topic::get_name </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the name of the topic. </p>
<dl class="section return"><dt>Returns</dt><dd>The name of the topic. </dd></dl>

</div>
</div>
<a class="anchor" id="aa155b7dc33fa0ef8ecace578cace2d4e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int mqtt::topic::get_qos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the default quality of service for this topic. </p>
<dl class="section return"><dt>Returns</dt><dd>The default quality of service for this topic. </dd></dl>

</div>
</div>
<a class="anchor" id="a570c51a6a1b004aa64754102239e3116"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool mqtt::topic::get_retained </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets the default retained flag used for this topic. </p>
<dl class="section return"><dt>Returns</dt><dd>The default retained flag used for this topic. </dd></dl>

</div>
</div>
<a class="anchor" id="a245cb5fa74d692edf1f069b6cbdd2809"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">delivery_token_ptr mqtt::topic::publish </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Publishes a message on the topic using the default QoS and retained flag. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">n</td><td>the number of bytes in the payload </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The delivery token used to track and wait for the publish to complete. </dd></dl>

</div>
</div>
<a class="anchor" id="a32155e22ade2879fda7eb6af94e1edc2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">delivery_token_ptr mqtt::topic::publish </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Publishes a message on the topic. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">n</td><td>the number of bytes in the payload </td></tr>
    <tr><td class="paramname">qos</td><td>the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. </td></tr>
    <tr><td class="paramname">retained</td><td>whether or not this message should be retained by the server. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The delivery token used to track and wait for the publish to complete. </dd></dl>

</div>
</div>
<a class="anchor" id="a8be5358f0ab80036184a89960daee9a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">delivery_token_ptr mqtt::topic::publish </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Publishes a message on the topic using the default QoS and retained flag. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The delivery token used to track and wait for the publish to complete. </dd></dl>

</div>
</div>
<a class="anchor" id="aa34a4625a889d5d1bfdf2f262ddade2d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">delivery_token_ptr mqtt::topic::publish </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Publishes a message on the topic. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the bytes to use as the message payload </td></tr>
    <tr><td class="paramname">qos</td><td>the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. </td></tr>
    <tr><td class="paramname">retained</td><td>whether or not this message should be retained by the server. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The delivery token used to track and wait for the publish to complete. </dd></dl>

</div>
</div>
<a class="anchor" id="a1503219df15de428ff11ecc69099a9b7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::topic::set_qos </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>qos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the default quality of service for this topic. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qos</td><td>The default quality of service for this topic. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6464a44498c4ceb14d7038ec45b88ab0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void mqtt::topic::set_retained </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>retained</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the default retained flag used for this topic. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">retained</td><td>The default retained flag used for this topic. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae38b14f29acefc573904e4ac71e69791"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">string mqtt::topic::to_string </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a string representation of this topic. </p>
<dl class="section return"><dt>Returns</dt><dd>The name of the topic </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mqtt/<a class="el" href="topic_8h_source.html">topic.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>mqtt</b></li><li class="navelem"><a class="el" href="classmqtt_1_1topic.html">topic</a></li>
    <li class="footer">Generated on Sun Jul 23 2017 10:24:30 for Paho C++ by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
